#include <iostream>
#include <cstring>
using namespace std;
const int N=25;
int t[N],d[N],l[N];
int q,n;
int newend=0;
bool st[20];
bool dfs(int pos,int end)
{
	if(pos>n)
	return true;
	for(int i=1;i<=n;i++)
	{
		if(st[i])continue;
		if(end>t[i]+d[i])continue;
		newend=max(end,t[i])+l[i];
		st[i]=true;
		if(dfs(pos+1,newend)) return true;
		st[i]=false;
	}
	return false;
}
int main()
{

	cin>>q
	while(q--)
   {
   	memset(st,0,sizeof st);
   	cin>>n;
   	for(int i=1;i<=n;i++)
      {
   	cin>>t[i]>>d[i]>>l[i];
      }
   	if(dfs(1,0))cout<<"YES"<<endl;
   	else cout<<"NO"<<endl;
	}
	return 0;
}
